<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    <canvas id="a"></canvas>
</body>

<script>

	var imageCanvas = document.getElementById( "a" ),
	context = imageCanvas.getContext( "2d" );

	imageCanvas.width = imageCanvas.height = 128;

	context.fillStyle = "#444";
	context.fillRect( 0, 0, 128, 128 );

	context.fillStyle = "#fff";
	context.fillRect( 0, 0, 64, 64);
	context.fillRect( 64, 64, 64, 64 );

	</script>
</html>